/**
 * @author Javen 
 * @copyright 2018-09-22 17:29:59 javendev@126.com 
 * @description 音效组件
 */
let BKTools = require("BKTools");

cc.Class({
  extends: cc.Component,
  properties: {
    onClickAudio: {
      default: null,
      tooltip: "按钮点击音效",
      type: cc.AudioClip,
    },
    logoAudio: {
      default: null,
      tooltip: "前方高能音效",
      type: cc.AudioClip
    },
  },

  playClickAudio() {
    cc.audioEngine.play(this.onClickAudio, false, 1);
  },
  playLogoAudio() {
    cc.audioEngine.play(this.logoAudio, false, 1);
  },

  //暂停现在正在播放的所有音频
  pauseAll() {
    cc.audioEngine.pauseAll();
  },
  //恢复播放所有之前暂停的所有音频
  resumeAll() {
    cc.audioEngine.resumeAll();
  },
  stopAll() {
    cc.audioEngine.stopAll();
  },

  onLoad() {
    if (cc.sys.platform == cc.sys.QQ_PLAY) {
      BKTools.addGameEvent();
      BKTools.log("初始化玩一玩生命周期以及游戏事件...");
    }
  },
  // start () {},

  // update (dt) {},
});